<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Menu/classes/PhpFox_ComponentAdminMenu.class.php, $Author:  $ */



class PhpFox_Mod_Menu_ComponentAdminMenu extends BaseComponent
{
    function process()
    {
        $aMenus = $this->getParam('aMenu');
        $bImporter = $this->getParam('bImporter');

        $iId = 1;
        foreach ($aMenus as $sKey => $aMenu)
        {
            $aMenus[$sKey]['id'] = $iId;
            $iId++;
            foreach($aMenu['items'] as $k=>$v)
            {
                if (is_array($v))
                {
                    $aMenus[$sKey]['items'][$k] = $v['title'];
                }
            }
        }
        $aShowMenus = array();
        for ($i = 1; $i <= 5; $i++)
        {
            if (isset($_COOKIE['sub'.$i]))
            {
                $aShowMenus[] = $i;
            }
        }

        $oTpl = &$this->_oModule->getTemplate();
        $oTpl->assign(array(
            'aParams'    => $this->_aParams,
            'aMenu'      => $aMenus,
            'aShowMenus' => $aShowMenus,
        ));

        return $oTpl->fetch('AdminMenu.html');
    }
}
?>